package ro.dandanciu.webgallery.services;

import java.util.List;

import ro.dandanciu.webgallery.domainmodel.Advert;
import ro.dandanciu.webgallery.domainmodel.User;

/**
 * Service for adverts.
 * 
 * @author Dan Danciu
 */
public interface AdvertiseServices {
	
	/**
	 * Persist an advert.
	 * @param advert the advert to be persisted.
	 */
	void save(Advert advert);
	
	/**
	 * Obtain the list of adverts for a user.
	 * @param user the user for whom we want the adverts.
	 * @return all the adverts a user has.
	 */
	List<Advert> getForUser(User user);

	/**
	 * Remove the advert for a user.
	 * @param user the user to have the advert remove.
	 * @param id the id of the advert.
	 * @return true if the user was in the list of user for the given advert, false otherwise.
	 */
	boolean removeForUser(User sessionUser, long id);
	
}
